﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:System="clr-namespace:System;assembly=mscorlib"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:view="clr-namespace:ASPItalia.ModelVirtualCasting.Silverlight.BackOffice.Views"
                    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:converter="clr-namespace:ASPItalia.ModelVirtualCasting.Silverlight.BackOffice.Converters"
                    xmlns:local="clr-namespace:ASPItalia.ModelVirtualCasting.Web.RiaServices"
                    mc:Ignorable="d">
    <converter:ColorCountConverter x:Key="ColorCountConverter" />

    <ControlTemplate x:Key="ValidationToolTipTemplate">
        <Grid x:Name="Root"
              Margin="5,0"
              Opacity="0"
              RenderTransformOrigin="0,0">
            <Grid.RenderTransform>
                <TranslateTransform x:Name="xform"
                                    X="-25" />
            </Grid.RenderTransform>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="OpenStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0" />
                        <VisualTransition GeneratedDuration="0:0:0.2"
                                          To="Open">
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X"
                                                               Storyboard.TargetName="xform">
                                    <SplineDoubleKeyFrame KeyTime="0:0:0.2"
                                                          Value="0" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                               Storyboard.TargetName="Root">
                                    <SplineDoubleKeyFrame KeyTime="0:0:0.2"
                                                          Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Closed">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                           Storyboard.TargetName="Root">
                                <SplineDoubleKeyFrame KeyTime="0"
                                                      Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Open">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X"
                                                           Storyboard.TargetName="xform">
                                <SplineDoubleKeyFrame KeyTime="0"
                                                      Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                           Storyboard.TargetName="Root">
                                <SplineDoubleKeyFrame KeyTime="0"
                                                      Value="1" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Background="#052A2E31"
                    CornerRadius="5"
                    Margin="4,4,-4,-4" />
            <Border Background="#152A2E31"
                    CornerRadius="4"
                    Margin="3,3,-3,-3" />
            <Border Background="#252A2E31"
                    CornerRadius="3"
                    Margin="2,2,-2,-2" />
            <Border Background="#352A2E31"
                    CornerRadius="2"
                    Margin="1,1,-1,-1" />
            <Border Background="#FFDC000C"
                    CornerRadius="2" />
            <Border CornerRadius="2">
                <TextBlock Foreground="White"
                           MaxWidth="250"
                           Margin="8,4,8,4"
                           TextWrapping="Wrap"
                           Text="{Binding (Validation.Errors)[0].ErrorContent}"
                           UseLayoutRounding="false" />
            </Border>
        </Grid>
    </ControlTemplate>

    <Style x:Key="SelectedModelListBox"
           TargetType="ListBox">
        <Setter Property="Padding"
                Value="1" />
        <Setter Property="Foreground"
                Value="#FF000000" />
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Top" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="TabNavigation"
                Value="Once" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
                Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility"
                Value="Auto" />
        <Setter Property="BorderBrush"
                Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen"
                                                                       Storyboard.TargetName="validationTooltip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>True</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="2">
                            <ScrollViewer x:Name="ScrollViewer"
                                          BorderBrush="Transparent"
                                          BorderThickness="0"
                                          Background="{TemplateBinding Background}"
                                          Padding="{TemplateBinding Padding}"
                                          TabNavigation="{TemplateBinding TabNavigation}"
                                          Style="{StaticResource ScrollViewerStyle1}">
                                <ItemsPresenter />
                            </ScrollViewer>
                        </Border>
                        <Border x:Name="ValidationErrorElement"
                                BorderBrush="#FFDB000C"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="2"
                                Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Placement="Right"
                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Template="{StaticResource ValidationToolTipTemplate}">
                                    <ToolTip.Triggers>
                                        <EventTrigger RoutedEvent="Canvas.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible"
                                                                                   Storyboard.TargetName="validationTooltip">
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <System:Boolean>true</System:Boolean>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </ToolTip.Triggers>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                            <Grid Background="Transparent"
                                  HorizontalAlignment="Right"
                                  Height="10"
                                  Margin="0,-4,-4,0"
                                  VerticalAlignment="Top"
                                  Width="10">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                      Fill="#FFDC000C"
                                      Margin="-1,3,0,0" />
                                <Path Data="M 0,0 L2,0 L 8,6 L8,8"
                                      Fill="#ffffff"
                                      Margin="-1,3,0,0" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="Width"
                Value="400" />
        <Setter Property="Height"
                Value="250" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Bottom" />
    </Style>

    <Style x:Key="ScrollBarStyle1"
           TargetType="ScrollBar">
        <Setter Property="MinWidth"
                Value="17" />
        <Setter Property="MinHeight"
                Value="17" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollBar">
                    <Grid x:Name="Root">
                        <Grid.Resources>
                            <ControlTemplate x:Key="RepeatButtonTemplate"
                                             TargetType="RepeatButton">
                                <Grid x:Name="Root"
                                      Background="Transparent">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="HorizontalIncrementTemplate"
                                             TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="Background">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundGradient">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundAnimation">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#7FFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#CCFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F2FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="Background">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundGradient">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundAnimation">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                   Storyboard.TargetName="Highlight">
                                                        <SplineDoubleKeyFrame KeyTime="0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#6BFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#C6FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#EAFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F4FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="DisabledElement">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value=".7" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Rectangle x:Name="Background"
                                               Fill="#FF1F3B53"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               StrokeThickness="1">
                                        <Rectangle.Stroke>
                                            <LinearGradientBrush EndPoint=".5,1"
                                                                 StartPoint=".5,0">
                                                <GradientStop Color="#FF647480"
                                                              Offset="1" />
                                                <GradientStop Color="#FFAEB7BF"
                                                              Offset="0" />
                                                <GradientStop Color="#FF919EA7"
                                                              Offset="0.35" />
                                                <GradientStop Color="#FF7A8A99"
                                                              Offset="0.35" />
                                            </LinearGradientBrush>
                                        </Rectangle.Stroke>
                                    </Rectangle>
                                    <Rectangle x:Name="BackgroundAnimation"
                                               Fill="#FF448DCA"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               Stroke="#00000000"
                                               StrokeThickness="1" />
                                    <Rectangle x:Name="BackgroundGradient"
                                               Margin="1"
                                               Opacity="0"
                                               RadiusY="1"
                                               RadiusX="1"
                                               Stroke="#FFFFFFFF"
                                               StrokeThickness="1">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush EndPoint=".7,1"
                                                                 StartPoint=".7,0">
                                                <GradientStop Color="#FFFFFFFF"
                                                              Offset="0.013" />
                                                <GradientStop Color="#F9FFFFFF"
                                                              Offset="0.375" />
                                                <GradientStop Color="#E5FFFFFF"
                                                              Offset="0.603" />
                                                <GradientStop Color="#C6FFFFFF"
                                                              Offset="1" />
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                    <Rectangle x:Name="Highlight"
                                               IsHitTestVisible="false"
                                               Margin="1"
                                               Opacity="0"
                                               RadiusY="1"
                                               RadiusX="1"
                                               Stroke="#FF6DBDD1"
                                               StrokeThickness="1" />
                                    <Path Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                                          Height="8"
                                          Stretch="Uniform"
                                          Width="4">
                                        <Path.Fill>
                                            <SolidColorBrush x:Name="ButtonColor"
                                                             Color="#FF333333" />
                                        </Path.Fill>
                                    </Path>
                                    <Rectangle x:Name="DisabledElement"
                                               Fill="#FFFFFFFF"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2" />
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="HorizontalDecrementTemplate"
                                             TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="Background">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundGradient">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundMouseOver">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#7FFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#CCFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F2FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="Background">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundGradient">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundPressed">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                   Storyboard.TargetName="Highlight">
                                                        <SplineDoubleKeyFrame KeyTime="0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#6BFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#C6FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#EAFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F4FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="DisabledElement">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value=".7" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Rectangle x:Name="Background"
                                               Fill="#FF1F3B53"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               StrokeThickness="1">
                                        <Rectangle.Stroke>
                                            <LinearGradientBrush EndPoint=".5,1"
                                                                 StartPoint=".5,0">
                                                <GradientStop Color="#FF647480"
                                                              Offset="1" />
                                                <GradientStop Color="#FFAEB7BF"
                                                              Offset="0" />
                                                <GradientStop Color="#FF919EA7"
                                                              Offset="0.35" />
                                                <GradientStop Color="#FF7A8A99"
                                                              Offset="0.35" />
                                            </LinearGradientBrush>
                                        </Rectangle.Stroke>
                                    </Rectangle>
                                    <Rectangle x:Name="BackgroundMouseOver"
                                               Fill="#FF448DCA"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               Stroke="#00000000"
                                               StrokeThickness="1" />
                                    <Rectangle x:Name="BackgroundPressed"
                                               Fill="#FF448DCA"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               Stroke="#00000000"
                                               StrokeThickness="1" />
                                    <Rectangle x:Name="BackgroundGradient"
                                               Margin="1"
                                               Opacity="0"
                                               RadiusY="1"
                                               RadiusX="1"
                                               Stroke="#FFFFFFFF"
                                               StrokeThickness="1">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush EndPoint=".7,1"
                                                                 StartPoint=".7,0">
                                                <GradientStop Color="#FFFFFFFF"
                                                              Offset="0.013" />
                                                <GradientStop Color="#F9FFFFFF"
                                                              Offset="0.375" />
                                                <GradientStop Color="#E5FFFFFF"
                                                              Offset="0.603" />
                                                <GradientStop Color="#C6FFFFFF"
                                                              Offset="1" />
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                    <Rectangle x:Name="Highlight"
                                               IsHitTestVisible="false"
                                               Margin="1"
                                               Opacity="0"
                                               RadiusY="1"
                                               RadiusX="1"
                                               Stroke="#FF6DBDD1"
                                               StrokeThickness="1" />
                                    <Path Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z "
                                          Height="8"
                                          Stretch="Uniform"
                                          Width="4">
                                        <Path.Fill>
                                            <SolidColorBrush x:Name="ButtonColor"
                                                             Color="#FF333333" />
                                        </Path.Fill>
                                    </Path>
                                    <Rectangle x:Name="DisabledElement"
                                               Fill="#FFFFFFFF"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2" />
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="VerticalIncrementTemplate"
                                             TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="Background">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundGradient">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundMouseOver">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#7FFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#CCFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F2FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="Background">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundGradient">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundPressed">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                   Storyboard.TargetName="Highlight">
                                                        <SplineDoubleKeyFrame KeyTime="0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#6BFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#C6FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#EAFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F4FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="DisabledElement">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value=".7" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Rectangle x:Name="Background"
                                               Fill="#FF1F3B53"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               StrokeThickness="1">
                                        <Rectangle.Stroke>
                                            <LinearGradientBrush EndPoint="1,.5"
                                                                 StartPoint="0,.5">
                                                <GradientStop Color="#FF647480"
                                                              Offset="1" />
                                                <GradientStop Color="#FFAEB7BF"
                                                              Offset="0" />
                                                <GradientStop Color="#FF919EA7"
                                                              Offset="0.35" />
                                                <GradientStop Color="#FF7A8A99"
                                                              Offset="0.35" />
                                            </LinearGradientBrush>
                                        </Rectangle.Stroke>
                                    </Rectangle>
                                    <Rectangle x:Name="BackgroundMouseOver"
                                               Fill="#FF448DCA"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               Stroke="#00000000"
                                               StrokeThickness="1" />
                                    <Rectangle x:Name="BackgroundPressed"
                                               Fill="#FF448DCA"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               Stroke="#00000000"
                                               StrokeThickness="1" />
                                    <Rectangle x:Name="BackgroundGradient"
                                               Margin="1"
                                               Opacity="0"
                                               RadiusY="1"
                                               RadiusX="1"
                                               Stroke="#FFFFFFFF"
                                               StrokeThickness="1">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush EndPoint="1,.7"
                                                                 StartPoint="0,.7">
                                                <GradientStop Color="#FFFFFFFF"
                                                              Offset="0.013" />
                                                <GradientStop Color="#F9FFFFFF"
                                                              Offset="0.375" />
                                                <GradientStop Color="#E5FFFFFF"
                                                              Offset="0.603" />
                                                <GradientStop Color="#C6FFFFFF"
                                                              Offset="1" />
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                    <Rectangle x:Name="Highlight"
                                               IsHitTestVisible="false"
                                               Margin="1"
                                               Opacity="0"
                                               RadiusY="1"
                                               RadiusX="1"
                                               Stroke="#FF6DBDD1"
                                               StrokeThickness="1" />
                                    <Path Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                                          Height="4"
                                          Stretch="Uniform"
                                          Width="8">
                                        <Path.Fill>
                                            <SolidColorBrush x:Name="ButtonColor"
                                                             Color="White" />
                                        </Path.Fill>
                                    </Path>
                                    <Rectangle x:Name="DisabledElement"
                                               Fill="#FFFFFFFF"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2" />
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="VerticalDecrementTemplate"
                                             TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="Background">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundGradient">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundMouseOver">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#7FFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#CCFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F2FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="Background">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundGradient">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundPressed">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                   Storyboard.TargetName="Highlight">
                                                        <SplineDoubleKeyFrame KeyTime="0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#6BFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#C6FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#EAFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F4FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="DisabledElement">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value=".7" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Rectangle x:Name="Background"
                                               Fill="#FF1F3B53"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               StrokeThickness="1">
                                        <Rectangle.Stroke>
                                            <LinearGradientBrush EndPoint="1,.5"
                                                                 StartPoint="0,.5">
                                                <GradientStop Color="#FF647480"
                                                              Offset="1" />
                                                <GradientStop Color="#FFAEB7BF"
                                                              Offset="0" />
                                                <GradientStop Color="#FF919EA7"
                                                              Offset="0.35" />
                                                <GradientStop Color="#FF7A8A99"
                                                              Offset="0.35" />
                                            </LinearGradientBrush>
                                        </Rectangle.Stroke>
                                    </Rectangle>
                                    <Rectangle x:Name="BackgroundMouseOver"
                                               Fill="#FF448DCA"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               Stroke="#00000000"
                                               StrokeThickness="1" />
                                    <Rectangle x:Name="BackgroundPressed"
                                               Fill="#FF448DCA"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2"
                                               Stroke="#00000000"
                                               StrokeThickness="1" />
                                    <Rectangle x:Name="BackgroundGradient"
                                               Margin="1"
                                               Opacity="0"
                                               RadiusY="1"
                                               RadiusX="1"
                                               Stroke="#FFFFFFFF"
                                               StrokeThickness="1">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush EndPoint="1,.7"
                                                                 StartPoint="0,.7">
                                                <GradientStop Color="#FFFFFFFF"
                                                              Offset="0.013" />
                                                <GradientStop Color="#F9FFFFFF"
                                                              Offset="0.375" />
                                                <GradientStop Color="#E5FFFFFF"
                                                              Offset="0.603" />
                                                <GradientStop Color="#C6FFFFFF"
                                                              Offset="1" />
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                    <Rectangle x:Name="Highlight"
                                               IsHitTestVisible="false"
                                               Margin="1"
                                               Opacity="0"
                                               RadiusY="1"
                                               RadiusX="1"
                                               Stroke="#FF6DBDD1"
                                               StrokeThickness="1" />
                                    <Path Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                                          Height="4"
                                          Stretch="Uniform"
                                          Width="8">
                                        <Path.Fill>
                                            <SolidColorBrush x:Name="ButtonColor"
                                                             Color="White" />
                                        </Path.Fill>
                                    </Path>
                                    <Rectangle x:Name="DisabledElement"
                                               Fill="#FFFFFFFF"
                                               Opacity="0"
                                               RadiusY="2"
                                               RadiusX="2" />
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="VerticalThumbTemplate"
                                             TargetType="Thumb">
                                <Grid>
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundMouseOver">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#7FFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#CCFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F2FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundPressed">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                   Storyboard.TargetName="Highlight">
                                                        <SplineDoubleKeyFrame KeyTime="0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#6BFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#C6FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#EAFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F4FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="ThumbVisual">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="0" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Grid x:Name="ThumbVisual"
                                          Margin="1,0,1,0">
                                        <Rectangle x:Name="Background"
                                                   RadiusY="2"
                                                   StrokeThickness="1"
                                                   Stroke="#FF585858" />
                                        <Rectangle x:Name="BackgroundMouseOver"
                                                   Fill="#FF448DCA"
                                                   Opacity="0"
                                                   Stroke="#00000000"
                                                   StrokeThickness="1" />
                                        <Rectangle x:Name="BackgroundPressed"
                                                   Fill="#FF448DCA"
                                                   Opacity="0"
                                                   RadiusY="2"
                                                   Stroke="#00000000"
                                                   StrokeThickness="0" />
                                        <Rectangle x:Name="BackgroundGradient"
                                                   Margin="1"
                                                   StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint="1,.7"
                                                                     StartPoint="0,.7">
                                                    <GradientStop Color="#FFFFFFFF"
                                                                  Offset="0" />
                                                    <GradientStop Color="#F9FFFFFF"
                                                                  Offset="0.375" />
                                                    <GradientStop Color="#E5FFFFFF"
                                                                  Offset="0.6" />
                                                    <GradientStop Color="#C6FFFFFF"
                                                                  Offset="1" />
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle x:Name="Highlight"
                                                   IsHitTestVisible="false"
                                                   Margin="1"
                                                   Opacity="0"
                                                   StrokeThickness="0" />
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="HorizontalThumbTemplate"
                                             TargetType="Thumb">
                                <Grid>
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundMouseOver">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#7FFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#CCFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F2FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundPressed">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                   Storyboard.TargetName="Highlight">
                                                        <SplineDoubleKeyFrame KeyTime="0"
                                                                              Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#6BFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#C6FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#EAFFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient">
                                                        <SplineColorKeyFrame KeyTime="0"
                                                                             Value="#F4FFFFFF" />
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="ThumbVisual">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                              Value="0" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Grid x:Name="ThumbVisual"
                                          Margin="0,1,0,1">
                                        <Rectangle x:Name="Background"
                                                   Fill="#FF1F3B53"
                                                   RadiusY="2"
                                                   RadiusX="2"
                                                   StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1"
                                                                     StartPoint=".5,0">
                                                    <GradientStop Color="#FF818F99"
                                                                  Offset="1" />
                                                    <GradientStop Color="#FFC2C9CE"
                                                                  Offset="0" />
                                                    <GradientStop Color="#FFB3BBC1"
                                                                  Offset="0.35" />
                                                    <GradientStop Color="#FF96A4B1"
                                                                  Offset="0.35" />
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle x:Name="BackgroundMouseOver"
                                                   Fill="#FF448DCA"
                                                   Opacity="0"
                                                   RadiusY="2"
                                                   RadiusX="2"
                                                   Stroke="#00000000"
                                                   StrokeThickness="1" />
                                        <Rectangle x:Name="BackgroundPressed"
                                                   Fill="#FF448DCA"
                                                   Opacity="0"
                                                   RadiusY="2"
                                                   RadiusX="2"
                                                   Stroke="#00000000"
                                                   StrokeThickness="1" />
                                        <Rectangle x:Name="BackgroundGradient"
                                                   Margin="1"
                                                   RadiusY="1"
                                                   RadiusX="1"
                                                   Stroke="#FFFFFFFF"
                                                   StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1"
                                                                     StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF"
                                                                  Offset="0.013" />
                                                    <GradientStop Color="#F9FFFFFF"
                                                                  Offset="0.375" />
                                                    <GradientStop Color="#E5FFFFFF"
                                                                  Offset="0.603" />
                                                    <GradientStop Color="#C6FFFFFF"
                                                                  Offset="1" />
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle x:Name="Highlight"
                                                   IsHitTestVisible="false"
                                                   Margin="1"
                                                   Opacity="0"
                                                   RadiusY="1"
                                                   RadiusX="1"
                                                   Stroke="#FF6DBDD1"
                                                   StrokeThickness="1" />
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="Root">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="HorizontalRoot">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Rectangle Grid.ColumnSpan="5"
                                       RadiusY="1"
                                       RadiusX="1"
                                       Stroke="#00000000"
                                       StrokeThickness="1">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0.5,0"
                                                         StartPoint="0.5,1">
                                        <GradientStop Color="#FFF4F6F7"
                                                      Offset="0" />
                                        <GradientStop Color="#FFF0F4F7"
                                                      Offset="0.344" />
                                        <GradientStop Color="#FFDFE3E6"
                                                      Offset="1" />
                                        <GradientStop Color="#FFE9EEF4"
                                                      Offset="0.527" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Rectangle Grid.ColumnSpan="5"
                                       Fill="{TemplateBinding Background}"
                                       RadiusY="1"
                                       RadiusX="1"
                                       Stroke="#00000000"
                                       StrokeThickness="1" />
                            <Rectangle Grid.ColumnSpan="5"
                                       Opacity=".375"
                                       RadiusY="1"
                                       RadiusX="1"
                                       StrokeThickness="1">
                                <Rectangle.Stroke>
                                    <LinearGradientBrush EndPoint="0.5,1"
                                                         StartPoint="0.5,0">
                                        <GradientStop Color="#FFA3AEB9"
                                                      Offset="0" />
                                        <GradientStop Color="#FF8399A9"
                                                      Offset="0.375" />
                                        <GradientStop Color="#FF718597"
                                                      Offset="0.375" />
                                        <GradientStop Color="#FF617584"
                                                      Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Stroke>
                            </Rectangle>
                            <Rectangle Grid.ColumnSpan="5"
                                       Margin="1"
                                       RadiusY="1"
                                       RadiusX="1">
                                <Rectangle.Stroke>
                                    <LinearGradientBrush EndPoint="0.5,.125"
                                                         StartPoint=".5,.875">
                                        <GradientStop Color="#33FFFFFF" />
                                        <GradientStop Color="#99FFFFFF"
                                                      Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Stroke>
                            </Rectangle>
                            <RepeatButton x:Name="HorizontalSmallDecrease"
                                          Grid.Column="0"
                                          IsTabStop="False"
                                          Interval="50"
                                          Margin="1"
                                          Template="{StaticResource HorizontalDecrementTemplate}"
                                          Width="16" />
                            <RepeatButton x:Name="HorizontalLargeDecrease"
                                          Grid.Column="1"
                                          IsTabStop="False"
                                          Interval="50"
                                          Template="{StaticResource RepeatButtonTemplate}"
                                          Width="0" />
                            <Thumb x:Name="HorizontalThumb"
                                   Background="{TemplateBinding Background}"
                                   Grid.Column="2"
                                   MinWidth="18"
                                   Template="{StaticResource HorizontalThumbTemplate}"
                                   Width="18" />
                            <RepeatButton x:Name="HorizontalLargeIncrease"
                                          Grid.Column="3"
                                          IsTabStop="False"
                                          Interval="50"
                                          Template="{StaticResource RepeatButtonTemplate}" />
                            <RepeatButton x:Name="HorizontalSmallIncrease"
                                          Grid.Column="4"
                                          IsTabStop="False"
                                          Interval="50"
                                          Margin="1"
                                          Template="{StaticResource HorizontalIncrementTemplate}"
                                          Width="16" />
                        </Grid>
                        <Grid x:Name="VerticalRoot"
                              Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Rectangle RadiusY="1"
                                       RadiusX="1"
                                       Grid.RowSpan="5"
                                       StrokeThickness="1"
                                       Stroke="White" />
                            <RepeatButton x:Name="VerticalSmallDecrease"
                                          Height="16"
                                          IsTabStop="False"
                                          Interval="50"
                                          Margin="1"
                                          Grid.Row="0"
                                          Template="{StaticResource VerticalDecrementTemplate}" />
                            <RepeatButton x:Name="VerticalLargeDecrease"
                                          Height="0"
                                          IsTabStop="False"
                                          Interval="50"
                                          Grid.Row="1"
                                          Template="{StaticResource RepeatButtonTemplate}" />
                            <Thumb x:Name="VerticalThumb"
                                   Height="18"
                                   MinHeight="18"
                                   Grid.Row="2"
                                   Template="{StaticResource VerticalThumbTemplate}" />
                            <RepeatButton x:Name="VerticalLargeIncrease"
                                          IsTabStop="False"
                                          Interval="50"
                                          Grid.Row="3"
                                          Template="{StaticResource RepeatButtonTemplate}" />
                            <RepeatButton x:Name="VerticalSmallIncrease"
                                          Height="16"
                                          IsTabStop="False"
                                          Interval="50"
                                          Margin="1"
                                          Grid.Row="4"
                                          Template="{StaticResource VerticalIncrementTemplate}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollViewerStyle1"
           TargetType="ScrollViewer">
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Top" />
        <Setter Property="VerticalScrollBarVisibility"
                Value="Visible" />
        <Setter Property="Padding"
                Value="4" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0">
                    <GradientStop Color="#FFA3AEB9"
                                  Offset="0" />
                    <GradientStop Color="#FF8399A9"
                                  Offset="0.375" />
                    <GradientStop Color="#FF718597"
                                  Offset="0.375" />
                    <GradientStop Color="#FF617584"
                                  Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Border BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="2">
                        <Grid Background="{TemplateBinding Background}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ScrollContentPresenter x:Name="ScrollContentPresenter"
                                                    Cursor="{TemplateBinding Cursor}"
                                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                                    Margin="{TemplateBinding Padding}" />
                            <Rectangle Grid.Column="1"
                                       Fill="#FFE9EEF4"
                                       Grid.Row="1" />
                            <ScrollBar x:Name="VerticalScrollBar"
                                       Grid.Column="1"
                                       IsTabStop="False"
                                       Maximum="{TemplateBinding ScrollableHeight}"
                                       Margin="0,-1,-1,-1"
                                       Minimum="0"
                                       Orientation="Vertical"
                                       Grid.Row="0"
                                       Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                       Value="{TemplateBinding VerticalOffset}"
                                       ViewportSize="{TemplateBinding ViewportHeight}"
                                       Width="18"
                                       Style="{StaticResource ScrollBarStyle1}" />
                            <ScrollBar x:Name="HorizontalScrollBar"
                                       Grid.Column="0"
                                       Height="18"
                                       IsTabStop="False"
                                       Maximum="{TemplateBinding ScrollableWidth}"
                                       Margin="-1,0,-1,-1"
                                       Minimum="0"
                                       Orientation="Horizontal"
                                       Grid.Row="1"
                                       Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                       Value="{TemplateBinding HorizontalOffset}"
                                       ViewportSize="{TemplateBinding ViewportWidth}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DataGridRowStyle"
           TargetType="sdk:DataGridRow">
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="sdk:DataGridRow">
                    <sdk:DataGridFrozenGrid x:Name="Root"
                                            d:DesignWidth="298"
                                            d:DesignHeight="235">
                        <sdk:DataGridFrozenGrid.Resources>
                            <Storyboard x:Key="DetailsVisibleTransition">
                                <DoubleAnimation Duration="00:00:0.1"
                                                 Storyboard.TargetProperty="ContentHeight"
                                                 Storyboard.TargetName="DetailsPresenter" />
                            </Storyboard>
                        </sdk:DataGridFrozenGrid.Resources>
                        <sdk:DataGridFrozenGrid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </sdk:DataGridFrozenGrid.ColumnDefinitions>
                        <sdk:DataGridFrozenGrid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </sdk:DataGridFrozenGrid.RowDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="NormalAlternatingRow">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="0"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="BackgroundRectangle" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To=".5"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="BackgroundRectangle" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NormalSelected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="BackgroundRectangle" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOverSelected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="BackgroundRectangle" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="UnfocusedSelected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="BackgroundRectangle" />
                                        <ColorAnimation Duration="0"
                                                        To="#FFE1E7EC"
                                                        Storyboard.TargetProperty="(Fill).Color"
                                                        Storyboard.TargetName="BackgroundRectangle" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="Invalid">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="BackgroundRectangle">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="InvalidVisualElement" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="BackgroundRectangle"
                                   Grid.ColumnSpan="2"
                                   Fill="{Binding RelativeSource={RelativeSource AncestorType=view:ViewPageBase}, Path=DataContext.SelectedItemsCount, Converter={StaticResource ColorCountConverter}}"
                                   Opacity="0"
                                   Grid.RowSpan="2">
                        </Rectangle>
                        <Rectangle x:Name="InvalidVisualElement"
                                   Grid.ColumnSpan="2"
                                   Fill="White"
                                   Opacity="0"
                                   Grid.RowSpan="2" />
                        <sdk:DataGridRowHeader x:Name="RowHeader"
                                               sdk:DataGridFrozenGrid.IsFrozen="True"
                                               Grid.RowSpan="3" />
                        <sdk:DataGridCellsPresenter x:Name="CellsPresenter"
                                                    Grid.Column="1"
                                                    sdk:DataGridFrozenGrid.IsFrozen="True" />
                        <sdk:DataGridDetailsPresenter x:Name="DetailsPresenter"
                                                      Grid.Column="1"
                                                      Grid.Row="1" />
                        <Button Content="Button"
                                Grid.Column="1"
                                HorizontalAlignment="Right"
                                VerticalAlignment="Center"
                                Command="{Binding RelativeSource={RelativeSource AncestorType=data:DataGrid}, Path=DataContext.ViewDetailsCommand}"
                                CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=data:DataGrid}, Path=SelectedItem}" />
                        
                        <Rectangle x:Name="BottomGridLine"
                                   Grid.Column="1"
                                   HorizontalAlignment="Stretch"
                                   Height="1"
                                   Grid.Row="2" />
                    </sdk:DataGridFrozenGrid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ButtonStyle1" TargetType="Button">
    	<Setter Property="Background" Value="#FF1F3B53"/>
    	<Setter Property="Foreground" Value="#FF000000"/>
    	<Setter Property="Padding" Value="3"/>
    	<Setter Property="BorderThickness" Value="1"/>
    	<Setter Property="BorderBrush">
    		<Setter.Value>
    			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    				<GradientStop Color="#FFA3AEB9" Offset="0"/>
    				<GradientStop Color="#FF8399A9" Offset="0.375"/>
    				<GradientStop Color="#FF718597" Offset="0.375"/>
    				<GradientStop Color="#FF617584" Offset="1"/>
    			</LinearGradientBrush>
    		</Setter.Value>
    	</Setter>
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="Button">
    				<Grid>
    					<VisualStateManager.VisualStateGroups>
    						<VisualStateGroup x:Name="CommonStates">
    							<VisualState x:Name="Normal"/>
    							<VisualState x:Name="MouseOver">
    								<Storyboard>
    									<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
    									<ColorAnimation Duration="0" To="#F2FF0000" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
    									<ColorAnimation Duration="0" To="#CCFF0000" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
    									<ColorAnimation Duration="0" To="#7FFF0000" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
    								</Storyboard>
    							</VisualState>
    							<VisualState x:Name="Pressed">
    								<Storyboard>
    									<ColorAnimation Duration="0" To="#FF6DBDD1" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Background"/>
    									<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
    									<ColorAnimation Duration="0" To="#D8FFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
    									<ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
    									<ColorAnimation Duration="0" To="#8CFFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
    									<ColorAnimation Duration="0" To="#3FFFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
    								</Storyboard>
    							</VisualState>
    							<VisualState x:Name="Disabled">
    								<Storyboard>
    									<DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
    								</Storyboard>
    							</VisualState>
    						</VisualStateGroup>
    						<VisualStateGroup x:Name="FocusStates">
    							<VisualState x:Name="Focused">
    								<Storyboard>
    									<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
    								</Storyboard>
    							</VisualState>
    							<VisualState x:Name="Unfocused"/>
    						</VisualStateGroup>
    					</VisualStateManager.VisualStateGroups>
    					<Border x:Name="Background" BorderThickness="2" Background="#FF8399A9">
    						<Border.BorderBrush>
    							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    								<GradientStop Color="#FFA3AEB9" Offset="0"/>
    								<GradientStop Color="#FF8399A9" Offset="1"/>
    							</LinearGradientBrush>
    						</Border.BorderBrush>
    						<Grid>
    							<Border x:Name="BackgroundAnimation" Background="#FF448DCA" Opacity="0"/>
    							<Rectangle x:Name="BackgroundGradient">
    								<Rectangle.Fill>
    									<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
    										<GradientStop Color="#FFFFFFFF" Offset="0"/>
    										<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
    										<GradientStop Color="#E5FFFFFF" Offset="0.625"/>
    										<GradientStop Color="#C6FFFFFF" Offset="1"/>
    									</LinearGradientBrush>
    								</Rectangle.Fill>
    							</Rectangle>
    						</Grid>
    					</Border>
    					<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
    					<Rectangle x:Name="DisabledVisualElement" Fill="#FFFFFFFF" IsHitTestVisible="false" Opacity="0" RadiusY="3" RadiusX="3"/>
    					<Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1"/>
    				</Grid>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    </Style>

    <local:StyleManager x:Key="StyleManager" />
    <Style x:Key="textBoxBaseStyle"
           TargetType="TextBox">
        <Setter Property="Margin"
                Value="5" />
        <Setter Property="Foreground"
                Value="{Binding Foreground, Source={StaticResource StyleManager}}" />
        <Setter Property="FontSize"
                Value="18" />
        <Setter Property="TextWrapping"
                Value="Wrap" />
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
    </Style>

</ResourceDictionary>
